home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MIDICraft's MIDINET CD-ROM
/
MIDICraft's MIDINET CD-ROM.iso
/
DOSUTILS
/
MIDIDIR.DOC
< prev
next >
Wrap
Text File
|
1997-03-15
|
10KB
|
263 lines
******************************
MIDIDIR v1.4
midi directory listing
by Guenter Nagler
1996
(gnagler@ihm.tu-graz.ac.at)
******************************
[0] FEATURES
+ scans subdirectories for binary midi files
+ guesses title of the midi files
+ shows directory, filename, title, file size, format and number of tracks
+ filename mask using wildcards ? and * can be used
+ search words (may contain wildcards ? and *) to find certain titles
+ can add title to a midi file
+ shows midi mode (GM, GS, XG)
+ produce database importable text
+ karaoke titles have higher priorities
+ try to filter bad titles (e.g. advertisement)
[1] BACKGROUND
This program was not my idea. The idea came from a person on net that asked
for a simple way to generate a midi listing of a midi archive.
Some answers suggested using MSDOS command "dir /S" to get a list.
When I posted a zip file containing some of my midi files I added a file listing
as content to the article description. I manually edited the content and got
unexpected positive reactions for this listing.
So I thought that there must be a better way than "dir /S" to get a more
detailed listing ( short DOS filenames often do not help).
Therefore I started this project mididir that be a simply way to
1. get a directory listing (possibly with information about the midi files).
2. set title of a midi file
[2] FILES DESCRIPTION
MIDIDIR.EXE.........converter program
MIDIDIR.DOC.........this file, showing usage of MIDIDIR.EXE
MIDIIO.HPP..........header file for a c++ midi parser
MIDIIO.CPP..........source code for a c++ midi parser
MIDIDIR.CPP.........c++ source code for directory listing and adding title
MIDIDIR.MAK.........make file for project
MIDIDIR.CFG.........compiler options for make
MIDIDIR.PRJ.........compiler project for Borland (tm) c++ compilers
only MIDIDIR.EXE is required to run program
[3] COPYRIGHT
MIDIDIR (c) 1996 was created by Guenter Nagler.
MIDIDIR is free and may be used as you wish with this one exception:
You may NOT charge any fee or derive any profit for distribution
of MIDIDIR. Thus, you may NOT sell or bundle MIDIDIR with any
product in a retail environment (shareware disk distribution, CD-ROM,
etc.) without permission of the author.
You may give MIDIDIR to your friends, upload it to a BBS, or ftp it to
another internet site, as long as you don't charge anything for it.
[4] DISCLAIMER
MIDIDIR was designed to handle 100% compatible midi files.
It was tested with many files but I can not say if
each 100% midi compatible midi file can be correctly converted.
So I give no guarantees of the results, especially with non 100%
compatible midi files.
If you find a midi file that you think to be 100% compatible midi
that is not correctly converted, please send a sample file to
gnagler@ihm.tu-graz.ac.at .
Use MIDIDIR at your own risk. Anything you do with MIDIDIR is your
responsibility, and not the author's. Any damage caused to any person,
computer, software, hardware, company, or business by running MIDIDIR
is your responsibility, and the author will not be liable.
If you don't understand these terms, or are not sure of something, or
are afraid something bad might come of using MIDIDIR, don't use it!
You are here forewarned.
[5] INSTALLATION
[MSDOS]
Simply copy MIDIDIR.EXE in a directory that is in your path.
When you start the program without arguments
[UNIX]
compile sources with your C++ compiler (e.g. GNU Compiler g++):
g++ -o mididir mididir.cpp midiio.cpp
and run program
$ mididir -h
C:\> MIDIDIR -h
you should get the usage text (see next section)
[6] USAGE
usage: MIDIDIR [-addtitle "title"] [-search "words"] files ...
The parts in brackets [...] are optional.
The program MIDIDIR allows following option:
-version get program version
-addtitle "title" add title of a single file
-search "words" list only midi files with title containing the words
-database produce database importable format
Warning:
option -addtitle modifies the original file!
Warning:
Only on MSDOS system filemasks and subdirectories are handled internally by
this program. Under Unix the shell handles filemasks and subdirectories, so
use this in following manner (Unix only):
$ mididir *.mid */*.mid
searches all files matching *.mid in current directory and subdirectories
for rekursive directory listing (deep nested) use Unix command find to start
mididir for each matching file. See Unix manual "man find" for description.
Karaoke titles ("@T...") are prefered, because if a song contains lyrics
it is more likely that the title is added correctly.
[8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
WWW: http://hgiicm.tu-graz.ac.at/Cpub
contains all my dos/unix midi programs
EMAIL: gnagler@ihm.tu-graz.ac.at
[9] USE
example: get version of program
> mididir -v
mididir v1.0 by Günter Nagler (13 Aug 1996)
example: get usage help
> mididir -h
usage: mididir [-addtitle "title"] [-search "words"] files ...
example: search all midi files in current directory or subdirectories
> mididir
BONJOVI\KEPFAITH.MID: Keep The Faith (58 kb, format 1, 11 tracks)
BONJOVI\ARMS.MID: In These Arms (45 kb, format 1, 9 tracks)
BONJOVI\BLAZE.MID: (92 kb, format 1, 31 tracks)
KARAOKE\LIKECHOP.KAR: I Like Chopin (41 kb, format 1, 11 tracks)
Lets interpret this output:
BONJOVI\ tells that the file is in subdirectory BONJOVI
KEPFAITH.MID is the name of the file
Keep The Faith is probably the title of the midi
58 kb This is the size of midi file in kilobytes
format 1 This is the format of midi file (0, 1, 2)
11 tracks There are 11 different midi tracks
Warning: There is no midi title defined in midi standard, so this is the
first trackname or first text found in midi file. Usually this contains
something like a title, but it is optional or could be used for other
information.
example: search only karaoke files
> mididir *.kar
KARAOKE\LIKECHOP.KAR: I Like Chopin (41 kb, format 1, 11 tracks)
example: search only files containing word "faith" in title
> mididir -s "faith"
BONJOVI\KEPFAITH.MID: Keep The Faith (58 kb, format 1, 11 tracks)
example: complex search for more words containing wildcards
> mididir -s "k t?e f*th"
BONJOVI\KEPFAITH.MID: Keep The Faith (58 kb, format 1, 11 tracks)
letter case is ignored, so first word "k" is contained in "Keep"
t?e matches "The", because ? can be any character
f*th matches "Faith", because * can be any character combination (even empty)
example: give blaze.mid a new title
> mididir -a "Blaze of Glory" bonjovi\blaze.mid
Warning: this will modify the original file, so backup it if original
file is important!
example: test new title of blaze.mid
C:> mididir blaze.mid
BONJOVI\BLAZE.MID: Blaze of Glory (92 kb, format 1, 31 tracks)
example: produce a database about midi files information
c:> mididir -database *.mid *.kar > midilist.txt
The file midilist.txt will contain lines like:
Filename;Title/Artist;Filesize;Format;Tracks;Error;Specialmode
RUNAWAY.MID;BON JOVI - Runaway;40524;1;8;;
ECLIPSE.KAR;Total Eclipse of the Heart;40023;1;21;; GS
TOTALECL.MID;;48759;1;12;;
... and more
Each line describes a midi file and builds a database record.
The ; characters are field separators.
Following fields are generated:
Filename;Title/Artist;Filesize;Format;Tracks;Error;Specialmode
Filename (path, name, extension)
Title/Artist (optional title or artist)
Filesize (number of bytes)
Format (0, 1, 2)
Tracks (Number of midi tracks)
Error (optional error message)
Specialmode (optional GM, GS, XG if midi contains a midi reset sysex)
Start your database application (e.g. Excel, Access, Works, StarCalc ...)
and open/import the text file (field separator is semicolon ";"). Now you
can sort by filename, title, filesize, version and other fields.
Warning:
The title often is missing or not recognizable, because midi file
format doesn't mark a certain text to be a title or artist information.
Any text in the midi file could be the title or artist, often none of
the text lines is a title/artist. This causes mididir sometimes to
show wrong midi title.
Hints: to get all text information from the midi use
miditrk or midifind [8]
Warning: All files that do not appear to be standard midi format are
ignored. A message at end of program shows the number of ignored files.
example: mididir collects midi files automatically, ignoring non-midi files
c:> mididir
BONJOVI\BLAZE.MID: Blaze of Glory (92 kb, format 1, 31 tracks)
Warning: 33 files ignored (they are not standard midi files)
Hint: if the output of mididir is written to a file or printer ( > or >> )
then the warning is printed on screen.
Hint: mididir without arguments is same as "mididir *.*"
[7] CHANGES
v1.0 to v1.1:
* updated midiio
* added recognition of sysex midi mode initialization
(GM=General Midi, GS=Roland General Midi, XG=Yamaha General Midi)
v1.1 to v1.2:
* added option -database to write a database importable file
* ignores certain words that usually do not contain title or artist (e.g.
unreadable text, advertisement, URLs...)
v1.2 to v1.3:
* speeding up program by skipping all events that are behind a time limit.
All needed information (title, tracks, reset,...) usually are done near
beginning of midi tracks.
* trying to continue directory listing even if reading corrupt midi file.
v1.3 to v1.4:
* long filename support for DOS 7.0/Windows95
* warning when ignoring non-midi files